﻿/*
版权所有：版权所有(C) 2010，刘建新
文件编号：M01_Companyinfo.cs
文件名称：Companyinfo.cs
系统编号：Z0003007
系统名称：通用办公系统
模块编号：M01
模块名称：信息发布
设计文档：IOA_M01信息发布XDE建模.mdx
完成日期：2010/12/17
作　　者：
内容摘要：表[CompanyInfo]对应的实体类
*/

using System;
using System.Collections;
using System.Data;


namespace Eis51.CampanyCMS.Model.BaseInfoMng
{
		/// <summary>
		/// 类 编 号：
		/// 类 名 称：Companyinfo
		/// 内容摘要：
		/// </summary>
		
		[Serializable]
		public class Companyinfo : BaseModel
		{
		#region 自动生成代码
		
			#region 重载Equals/GetHashCode
			/// <summary>
			/// 重载Equals			
			/// </summary>
			public override bool Equals (Object obj)
			{
				if (obj != null && obj is Companyinfo)
				{
					if (obj == this)
						return true;
					Companyinfo castObj = (Companyinfo)obj; 
					
					if (!this.m_Seqno.Equals(castObj.Seqno))
						return false;
						
					if (!this.m_Title.Equals(castObj.Title))
						return false;
						
					if (!this.m_Description.Equals(castObj.Description))
						return false;
						
					if (!this.m_Introduction.Equals(castObj.Introduction))
						return false;
						
					if (!this.m_Code.Equals(castObj.Code))
						return false;
						
					if (!this.m_Filename.Equals(castObj.Filename))
						return false;
						
					if (!this.m_KeyWord.Equals(castObj.KeyWord))
						return false;
						
					if (!this.m_ContactUs.Equals(castObj.ContactUs))
						return false;
						
					if (!this.m_AccStatisticsCode.Equals(castObj.AccStatisticsCode))
						return false;
						
					if (!this.m_Companyname.Equals(castObj.Companyname))
						return false;
						
					if (!this.m_Hangye.Equals(castObj.Hangye))
						return false;
						
					if (!this.m_Guimao.Equals(castObj.Guimao))
						return false;
						
					if (!this.m_Linkman.Equals(castObj.Linkman))
						return false;
						
					if (!this.m_Phone.Equals(castObj.Phone))
						return false;
						
					if (!this.m_Mobile.Equals(castObj.Mobile))
						return false;
						
					if (!this.m_Address.Equals(castObj.Address))
						return false;
						
					if (!this.m_Zip.Equals(castObj.Zip))
						return false;
						
					if (!this.m_Email.Equals(castObj.Email))
						return false;
						
					if (!this.m_Fax.Equals(castObj.Fax))
						return false;
						
					if (!this.m_Qq.Equals(castObj.Qq))
						return false;
						
					if (!this.m_Msn.Equals(castObj.Msn))
						return false;
						
					if (!this.m_Shenfen.Equals(castObj.Shenfen))
						return false;
						
					if (!this.m_City.Equals(castObj.City))
						return false;
						
					if (!this.m_Createby.Equals(castObj.Createby))
						return false;
						
					if (!this.m_Createdate.Equals(castObj.Createdate))
						return false;
						
					if (!this.m_LasteupdateDate.Equals(castObj.LasteupdateDate))
						return false;
						
					if (!this.m_Licd.Equals(castObj.Licd))
						return false;
						
					return true;
				}
				return false;
			}
			
			/// <summary>
			/// 重载GetHashCode
			/// </summary>
			public override int GetHashCode()
			{
					int hash = 0;					
					
					hash = hash <<  8;
					if ((object)m_Seqno != null)
					{
						hash = hash ^ m_Seqno.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Title != null)
					{
						hash = hash ^ m_Title.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Description != null)
					{
						hash = hash ^ m_Description.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Introduction != null)
					{
						hash = hash ^ m_Introduction.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Code != null)
					{
						hash = hash ^ m_Code.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Filename != null)
					{
						hash = hash ^ m_Filename.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_KeyWord != null)
					{
						hash = hash ^ m_KeyWord.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_ContactUs != null)
					{
						hash = hash ^ m_ContactUs.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_AccStatisticsCode != null)
					{
						hash = hash ^ m_AccStatisticsCode.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Companyname != null)
					{
						hash = hash ^ m_Companyname.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Hangye != null)
					{
						hash = hash ^ m_Hangye.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Guimao != null)
					{
						hash = hash ^ m_Guimao.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Linkman != null)
					{
						hash = hash ^ m_Linkman.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Phone != null)
					{
						hash = hash ^ m_Phone.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Mobile != null)
					{
						hash = hash ^ m_Mobile.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Address != null)
					{
						hash = hash ^ m_Address.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Zip != null)
					{
						hash = hash ^ m_Zip.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Email != null)
					{
						hash = hash ^ m_Email.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Fax != null)
					{
						hash = hash ^ m_Fax.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Qq != null)
					{
						hash = hash ^ m_Qq.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Msn != null)
					{
						hash = hash ^ m_Msn.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Shenfen != null)
					{
						hash = hash ^ m_Shenfen.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_City != null)
					{
						hash = hash ^ m_City.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Createby != null)
					{
						hash = hash ^ m_Createby.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Createdate != null)
					{
						hash = hash ^ m_Createdate.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_LasteupdateDate != null)
					{
						hash = hash ^ m_LasteupdateDate.GetHashCode();
					}
						
					hash = hash <<  8;
					if ((object)m_Licd != null)
					{
						hash = hash ^ m_Licd.GetHashCode();
					}
						
					return hash; 
			}
			#endregion
			
			public Companyinfo()
			{
				MarkNew();
			}						
			
			public Companyinfo GetOldValue()
			{
				return OldValue as Companyinfo;
			}
		
		#region Seqno属性
			private int m_Seqno = 0;
			/// <summary>
			/// 属性名称： Seqno
			/// 内容摘要： DB列名：Seqno[自动编号]
			///            DB类型：int
			/// </summary>
			public int Seqno
			{
				get
					{
						return m_Seqno;
					}
				set
					{
						if (m_Seqno as object == null || !m_Seqno.Equals(value))
						{
							m_Seqno = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Title属性
			private string m_Title = String.Empty;
			/// <summary>
			/// 属性名称： Title
			/// 内容摘要： DB列名：Title[页面的头属性]
			///            DB类型：string
			/// </summary>
			public string Title
			{
				get
					{
						return m_Title;
					}
				set
					{
						if (m_Title as object == null || !m_Title.Equals(value))
						{
							m_Title = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Description属性
			private string m_Description = String.Empty;
			/// <summary>
			/// 属性名称： Description
			/// 内容摘要： DB列名：Description[页面的description属性]
			///            DB类型：string
			/// </summary>
			public string Description
			{
				get
					{
						return m_Description;
					}
				set
					{
						if (m_Description as object == null || !m_Description.Equals(value))
						{
							m_Description = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Introduction属性
			private string m_Introduction = String.Empty;
			/// <summary>
			/// 属性名称： Introduction
			/// 内容摘要： DB列名：Introduction[公司介绍]
			///            DB类型：string
			/// </summary>
			public string Introduction
			{
				get
					{
						return m_Introduction;
					}
				set
					{
						if (m_Introduction as object == null || !m_Introduction.Equals(value))
						{
							m_Introduction = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Code属性
			private string m_Code = String.Empty;
			/// <summary>
			/// 属性名称： Code
			/// 内容摘要： DB列名：Code[编码]
			///            DB类型：string
			/// </summary>
			public string Code
			{
				get
					{
						return m_Code;
					}
				set
					{
						if (m_Code as object == null || !m_Code.Equals(value))
						{
							m_Code = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Filename属性
			private string m_Filename = String.Empty;
			/// <summary>
			/// 属性名称： Filename
			/// 内容摘要： DB列名：FileName[文件路径，可以是Flash，Logo等。]
			///            DB类型：string
			/// </summary>
			public string Filename
			{
				get
					{
						return m_Filename;
					}
				set
					{
						if (m_Filename as object == null || !m_Filename.Equals(value))
						{
							m_Filename = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region KeyWord属性
			private string m_KeyWord = String.Empty;
			/// <summary>
			/// 属性名称： KeyWord
			/// 内容摘要： DB列名：Key_Word[关键字，页面的关键字]
			///            DB类型：string
			/// </summary>
			public string KeyWord
			{
				get
					{
						return m_KeyWord;
					}
				set
					{
						if (m_KeyWord as object == null || !m_KeyWord.Equals(value))
						{
							m_KeyWord = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region ContactUs属性
			private string m_ContactUs = String.Empty;
			/// <summary>
			/// 属性名称： ContactUs
			/// 内容摘要： DB列名：Contact_Us[联系我们页面的显示内容。]
			///            DB类型：string
			/// </summary>
			public string ContactUs
			{
				get
					{
						return m_ContactUs;
					}
				set
					{
						if (m_ContactUs as object == null || !m_ContactUs.Equals(value))
						{
							m_ContactUs = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region AccStatisticsCode属性
			private string m_AccStatisticsCode = String.Empty;
			/// <summary>
			/// 属性名称： AccStatisticsCode
			/// 内容摘要： DB列名：Acc_Statistics_Code[网站统计代码]
			///            DB类型：string
			/// </summary>
			public string AccStatisticsCode
			{
				get
					{
						return m_AccStatisticsCode;
					}
				set
					{
						if (m_AccStatisticsCode as object == null || !m_AccStatisticsCode.Equals(value))
						{
							m_AccStatisticsCode = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Companyname属性
			private string m_Companyname = String.Empty;
			/// <summary>
			/// 属性名称： Companyname
			/// 内容摘要： DB列名：Companyname[公司名]
			///            DB类型：string
			/// </summary>
			public string Companyname
			{
				get
					{
						return m_Companyname;
					}
				set
					{
						if (m_Companyname as object == null || !m_Companyname.Equals(value))
						{
							m_Companyname = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Hangye属性
			private string m_Hangye = String.Empty;
			/// <summary>
			/// 属性名称： Hangye
			/// 内容摘要： DB列名：hangye[行业]
			///            DB类型：string
			/// </summary>
			public string Hangye
			{
				get
					{
						return m_Hangye;
					}
				set
					{
						if (m_Hangye as object == null || !m_Hangye.Equals(value))
						{
							m_Hangye = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Guimao属性
			private string m_Guimao = String.Empty;
			/// <summary>
			/// 属性名称： Guimao
			/// 内容摘要： DB列名：guimao[规模]
			///            DB类型：string
			/// </summary>
			public string Guimao
			{
				get
					{
						return m_Guimao;
					}
				set
					{
						if (m_Guimao as object == null || !m_Guimao.Equals(value))
						{
							m_Guimao = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Linkman属性
			private string m_Linkman = String.Empty;
			/// <summary>
			/// 属性名称： Linkman
			/// 内容摘要： DB列名：Linkman[联系人]
			///            DB类型：string
			/// </summary>
			public string Linkman
			{
				get
					{
						return m_Linkman;
					}
				set
					{
						if (m_Linkman as object == null || !m_Linkman.Equals(value))
						{
							m_Linkman = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Phone属性
			private string m_Phone = String.Empty;
			/// <summary>
			/// 属性名称： Phone
			/// 内容摘要： DB列名：Phone[联系电话]
			///            DB类型：string
			/// </summary>
			public string Phone
			{
				get
					{
						return m_Phone;
					}
				set
					{
						if (m_Phone as object == null || !m_Phone.Equals(value))
						{
							m_Phone = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Mobile属性
			private string m_Mobile = String.Empty;
			/// <summary>
			/// 属性名称： Mobile
			/// 内容摘要： DB列名：Mobile[手机]
			///            DB类型：string
			/// </summary>
			public string Mobile
			{
				get
					{
						return m_Mobile;
					}
				set
					{
						if (m_Mobile as object == null || !m_Mobile.Equals(value))
						{
							m_Mobile = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Address属性
			private string m_Address = String.Empty;
			/// <summary>
			/// 属性名称： Address
			/// 内容摘要： DB列名：Address[详细地址]
			///            DB类型：string
			/// </summary>
			public string Address
			{
				get
					{
						return m_Address;
					}
				set
					{
						if (m_Address as object == null || !m_Address.Equals(value))
						{
							m_Address = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Zip属性
			private string m_Zip = String.Empty;
			/// <summary>
			/// 属性名称： Zip
			/// 内容摘要： DB列名：Zip[邮编]
			///            DB类型：string
			/// </summary>
			public string Zip
			{
				get
					{
						return m_Zip;
					}
				set
					{
						if (m_Zip as object == null || !m_Zip.Equals(value))
						{
							m_Zip = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Email属性
			private string m_Email = String.Empty;
			/// <summary>
			/// 属性名称： Email
			/// 内容摘要： DB列名：Email[邮件]
			///            DB类型：string
			/// </summary>
			public string Email
			{
				get
					{
						return m_Email;
					}
				set
					{
						if (m_Email as object == null || !m_Email.Equals(value))
						{
							m_Email = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Fax属性
			private string m_Fax = String.Empty;
			/// <summary>
			/// 属性名称： Fax
			/// 内容摘要： DB列名：Fax[传真]
			///            DB类型：string
			/// </summary>
			public string Fax
			{
				get
					{
						return m_Fax;
					}
				set
					{
						if (m_Fax as object == null || !m_Fax.Equals(value))
						{
							m_Fax = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Qq属性
			private string m_Qq = String.Empty;
			/// <summary>
			/// 属性名称： Qq
			/// 内容摘要： DB列名：Qq[qq]
			///            DB类型：string
			/// </summary>
			public string Qq
			{
				get
					{
						return m_Qq;
					}
				set
					{
						if (m_Qq as object == null || !m_Qq.Equals(value))
						{
							m_Qq = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Msn属性
			private string m_Msn = String.Empty;
			/// <summary>
			/// 属性名称： Msn
			/// 内容摘要： DB列名：Msn[MSN]
			///            DB类型：string
			/// </summary>
			public string Msn
			{
				get
					{
						return m_Msn;
					}
				set
					{
						if (m_Msn as object == null || !m_Msn.Equals(value))
						{
							m_Msn = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Shenfen属性
			private string m_Shenfen = String.Empty;
			/// <summary>
			/// 属性名称： Shenfen
			/// 内容摘要： DB列名：ShenFen[省份]
			///            DB类型：string
			/// </summary>
			public string Shenfen
			{
				get
					{
						return m_Shenfen;
					}
				set
					{
						if (m_Shenfen as object == null || !m_Shenfen.Equals(value))
						{
							m_Shenfen = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region City属性
			private string m_City = String.Empty;
			/// <summary>
			/// 属性名称： City
			/// 内容摘要： DB列名：City[城市]
			///            DB类型：string
			/// </summary>
			public string City
			{
				get
					{
						return m_City;
					}
				set
					{
						if (m_City as object == null || !m_City.Equals(value))
						{
							m_City = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Createby属性
			private string m_Createby = String.Empty;
			/// <summary>
			/// 属性名称： Createby
			/// 内容摘要： DB列名：CreateBy[创建人]
			///            DB类型：string
			/// </summary>
			public string Createby
			{
				get
					{
						return m_Createby;
					}
				set
					{
						if (m_Createby as object == null || !m_Createby.Equals(value))
						{
							m_Createby = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Createdate属性
			private DateTime m_Createdate = new DateTime(1900,1,1);
			/// <summary>
			/// 属性名称： Createdate
			/// 内容摘要： DB列名：CreateDate[创建时间]
			///            DB类型：DateTime
			/// </summary>
			public DateTime Createdate
			{
				get
					{
						return DateTime.Parse(m_Createdate.ToString("yyyy-MM-dd HH:mm:ss"));
					}
				set
					{
						if (m_Createdate as object == null || !m_Createdate.Equals(value))
						{
							m_Createdate = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region LasteupdateDate属性
			private DateTime m_LasteupdateDate = new DateTime(1900,1,1);
			/// <summary>
			/// 属性名称： LasteupdateDate
			/// 内容摘要： DB列名：LasteUpdate_date[最后更新时间]
			///            DB类型：DateTime
			/// </summary>
			public DateTime LasteupdateDate
			{
				get
					{
						return DateTime.Parse(m_LasteupdateDate.ToString("yyyy-MM-dd HH:mm:ss"));
					}
				set
					{
						if (m_LasteupdateDate as object == null || !m_LasteupdateDate.Equals(value))
						{
							m_LasteupdateDate = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region Licd属性
			private int m_Licd = 0;
			/// <summary>
			/// 属性名称： Licd
			/// 内容摘要： DB列名：Licd[语言类型]
			///            DB类型：int
			/// </summary>
			public int Licd
			{
				get
					{
						return m_Licd;
					}
				set
					{
						if (m_Licd as object == null || !m_Licd.Equals(value))
						{
							m_Licd = value;
							MarkUpdated();
						}						
					}
			}
		#endregion
		
		#region static CreateDataTable/FillDataRow/DataRow2Obj/Dt2Objs/FillDataTable
			/// <summary>
			/// 得到实体对应的DataTable
			/// </summary>
			/// <param name="tableName">表名</param>
			/// <param name="cne">列名映射选择:DB列名或属性名</param>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable(string tableName,ColumnNameEnum cne)
			{
				DataTable dtResult = new DataTable(tableName);
			
				if (cne == ColumnNameEnum.DBName)
				{
					dtResult.Columns.Add(new DataColumn("Seqno",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Title",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Description",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Introduction",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Code",typeof(string)));
					dtResult.Columns.Add(new DataColumn("FileName",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Key_Word",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Contact_Us",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Acc_Statistics_Code",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Companyname",typeof(string)));
					dtResult.Columns.Add(new DataColumn("hangye",typeof(string)));
					dtResult.Columns.Add(new DataColumn("guimao",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Linkman",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Phone",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Mobile",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Address",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Zip",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Email",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Fax",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Qq",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Msn",typeof(string)));
					dtResult.Columns.Add(new DataColumn("ShenFen",typeof(string)));
					dtResult.Columns.Add(new DataColumn("City",typeof(string)));
					dtResult.Columns.Add(new DataColumn("CreateBy",typeof(string)));
					dtResult.Columns.Add(new DataColumn("CreateDate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("LasteUpdate_date",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("Licd",typeof(int)));
				}
				else if (cne == ColumnNameEnum.PropertyName)
				{
					dtResult.Columns.Add(new DataColumn("Seqno",typeof(int)));
					dtResult.Columns.Add(new DataColumn("Title",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Description",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Introduction",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Code",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Filename",typeof(string)));
					dtResult.Columns.Add(new DataColumn("KeyWord",typeof(string)));
					dtResult.Columns.Add(new DataColumn("ContactUs",typeof(string)));
					dtResult.Columns.Add(new DataColumn("AccStatisticsCode",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Companyname",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Hangye",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Guimao",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Linkman",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Phone",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Mobile",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Address",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Zip",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Email",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Fax",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Qq",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Msn",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Shenfen",typeof(string)));
					dtResult.Columns.Add(new DataColumn("City",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Createby",typeof(string)));
					dtResult.Columns.Add(new DataColumn("Createdate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("LasteupdateDate",typeof(DateTime)));
					dtResult.Columns.Add(new DataColumn("Licd",typeof(int)));
				}
				return dtResult;
			}
			
			/// <summary>
			/// 得到实体对应的DataTable
			/// </summary>
			/// <param name="cne">列名映射选择:DB列名或属性名</param>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable(ColumnNameEnum cne)
			{
				return CreateDataTable(null,cne);
			}

			/// <summary>
			/// 得到实体对应的DataTable(默认列名映射为属性名)
			/// </summary>
			/// <returns>生成的DataTable</returns>
			static public DataTable CreateDataTable()
			{
				return CreateDataTable(ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 用当前对象值填充DaraRow
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			/// <param name="cne">dr的列名映射方式:DB列名或属性名</param>
			public void FillDataRow(DataRow dr,ColumnNameEnum cne)
			{
				if (dr == null)
				{
					throw new ArgumentNullException("dr");
				}
				if (ColumnNameEnum.DBName == cne)
				{
					dr["Seqno"] = this.Seqno;
					dr["Title"] = this.Title;
					dr["Description"] = this.Description;
					dr["Introduction"] = this.Introduction;
					dr["Code"] = this.Code;
					dr["FileName"] = this.Filename;
					dr["Key_Word"] = this.KeyWord;
					dr["Contact_Us"] = this.ContactUs;
					dr["Acc_Statistics_Code"] = this.AccStatisticsCode;
					dr["Companyname"] = this.Companyname;
					dr["hangye"] = this.Hangye;
					dr["guimao"] = this.Guimao;
					dr["Linkman"] = this.Linkman;
					dr["Phone"] = this.Phone;
					dr["Mobile"] = this.Mobile;
					dr["Address"] = this.Address;
					dr["Zip"] = this.Zip;
					dr["Email"] = this.Email;
					dr["Fax"] = this.Fax;
					dr["Qq"] = this.Qq;
					dr["Msn"] = this.Msn;
					dr["ShenFen"] = this.Shenfen;
					dr["City"] = this.City;
					dr["CreateBy"] = this.Createby;
					dr["CreateDate"] = this.Createdate;
					dr["LasteUpdate_date"] = this.LasteupdateDate;
					dr["Licd"] = this.Licd;
				}
				else if (ColumnNameEnum.PropertyName == cne)
				{
					dr["Seqno"] = this.Seqno;
					dr["Title"] = this.Title;
					dr["Description"] = this.Description;
					dr["Introduction"] = this.Introduction;
					dr["Code"] = this.Code;
					dr["Filename"] = this.Filename;
					dr["KeyWord"] = this.KeyWord;
					dr["ContactUs"] = this.ContactUs;
					dr["AccStatisticsCode"] = this.AccStatisticsCode;
					dr["Companyname"] = this.Companyname;
					dr["Hangye"] = this.Hangye;
					dr["Guimao"] = this.Guimao;
					dr["Linkman"] = this.Linkman;
					dr["Phone"] = this.Phone;
					dr["Mobile"] = this.Mobile;
					dr["Address"] = this.Address;
					dr["Zip"] = this.Zip;
					dr["Email"] = this.Email;
					dr["Fax"] = this.Fax;
					dr["Qq"] = this.Qq;
					dr["Msn"] = this.Msn;
					dr["Shenfen"] = this.Shenfen;
					dr["City"] = this.City;
					dr["Createby"] = this.Createby;
					dr["Createdate"] = this.Createdate;
					dr["LasteupdateDate"] = this.LasteupdateDate;
					dr["Licd"] = this.Licd;					
				}
			}
			
			/// <summary>
			/// 用当前对象值填充DaraRow(默认列名映射为属性名)
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			public void FillDataRow(DataRow dr)
			{
				this.FillDataRow(dr,ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 将DataRow转换成Companyinfo对象
			/// </summary>
			/// <param name="dr">由CreateTable生成的DataTable通过NewRow得到的DataRow对象</param>
			/// <param name="cne">dr的列名映射方式:DB列名或属性名</param>
			/// <returns>Companyinfo对象</returns>
			public static Companyinfo Dr2Obj(DataRow dr,ColumnNameEnum cne)
			{
				if (dr == null)
				{
					throw new ArgumentNullException("dr");
				}
				Companyinfo obj = new Companyinfo();
				if (ColumnNameEnum.DBName == cne)
				{
					obj.Seqno = (dr["Seqno"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Seqno"],typeof(int));
					obj.Title = (dr["Title"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Title"],typeof(string));
					obj.Description = (dr["Description"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Description"],typeof(string));
					obj.Introduction = (dr["Introduction"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Introduction"],typeof(string));
					obj.Code = (dr["Code"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Code"],typeof(string));
					obj.Filename = (dr["FileName"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["FileName"],typeof(string));
					obj.KeyWord = (dr["Key_Word"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Key_Word"],typeof(string));
					obj.ContactUs = (dr["Contact_Us"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Contact_Us"],typeof(string));
					obj.AccStatisticsCode = (dr["Acc_Statistics_Code"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Acc_Statistics_Code"],typeof(string));
					obj.Companyname = (dr["Companyname"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Companyname"],typeof(string));
					obj.Hangye = (dr["hangye"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["hangye"],typeof(string));
					obj.Guimao = (dr["guimao"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["guimao"],typeof(string));
					obj.Linkman = (dr["Linkman"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Linkman"],typeof(string));
					obj.Phone = (dr["Phone"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Phone"],typeof(string));
					obj.Mobile = (dr["Mobile"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Mobile"],typeof(string));
					obj.Address = (dr["Address"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Address"],typeof(string));
					obj.Zip = (dr["Zip"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Zip"],typeof(string));
					obj.Email = (dr["Email"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Email"],typeof(string));
					obj.Fax = (dr["Fax"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Fax"],typeof(string));
					obj.Qq = (dr["Qq"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Qq"],typeof(string));
					obj.Msn = (dr["Msn"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Msn"],typeof(string));
					obj.Shenfen = (dr["ShenFen"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["ShenFen"],typeof(string));
					obj.City = (dr["City"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["City"],typeof(string));
					obj.Createby = (dr["CreateBy"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["CreateBy"],typeof(string));
					obj.Createdate = (dr["CreateDate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["CreateDate"],typeof(DateTime));
					obj.LasteupdateDate = (dr["LasteUpdate_date"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["LasteUpdate_date"],typeof(DateTime));
					obj.Licd = (dr["Licd"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Licd"],typeof(int));
				}
				else if (ColumnNameEnum.PropertyName == cne)
				{
					obj.Seqno = (dr["Seqno"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Seqno"],typeof(int));
					obj.Title = (dr["Title"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Title"],typeof(string));
					obj.Description = (dr["Description"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Description"],typeof(string));
					obj.Introduction = (dr["Introduction"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Introduction"],typeof(string));
					obj.Code = (dr["Code"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Code"],typeof(string));
					obj.Filename = (dr["Filename"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Filename"],typeof(string));
					obj.KeyWord = (dr["KeyWord"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["KeyWord"],typeof(string));
					obj.ContactUs = (dr["ContactUs"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["ContactUs"],typeof(string));
					obj.AccStatisticsCode = (dr["AccStatisticsCode"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["AccStatisticsCode"],typeof(string));
					obj.Companyname = (dr["Companyname"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Companyname"],typeof(string));
					obj.Hangye = (dr["Hangye"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Hangye"],typeof(string));
					obj.Guimao = (dr["Guimao"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Guimao"],typeof(string));
					obj.Linkman = (dr["Linkman"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Linkman"],typeof(string));
					obj.Phone = (dr["Phone"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Phone"],typeof(string));
					obj.Mobile = (dr["Mobile"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Mobile"],typeof(string));
					obj.Address = (dr["Address"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Address"],typeof(string));
					obj.Zip = (dr["Zip"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Zip"],typeof(string));
					obj.Email = (dr["Email"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Email"],typeof(string));
					obj.Fax = (dr["Fax"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Fax"],typeof(string));
					obj.Qq = (dr["Qq"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Qq"],typeof(string));
					obj.Msn = (dr["Msn"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Msn"],typeof(string));
					obj.Shenfen = (dr["Shenfen"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Shenfen"],typeof(string));
					obj.City = (dr["City"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["City"],typeof(string));
					obj.Createby = (dr["Createby"] == Convert.DBNull) ? null  : (string)Convert.ChangeType(dr["Createby"],typeof(string));
					obj.Createdate = (dr["Createdate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["Createdate"],typeof(DateTime));
					obj.LasteupdateDate = (dr["LasteupdateDate"] == Convert.DBNull) ? new DateTime(1900,1,1)  : (DateTime)Convert.ChangeType(dr["LasteupdateDate"],typeof(DateTime));
					obj.Licd = (dr["Licd"] == Convert.DBNull) ? 0  : (int)Convert.ChangeType(dr["Licd"],typeof(int));		
				}
				
				return obj;
			}
			
			/// <summary>
			/// 将DataRow转换成Companyinfo对象(默认列名映射为属性名)
			/// </summary>
			/// <returns>Companyinfo对象</returns>
			public static Companyinfo Dr2Obj(DataRow dr)
			{
				return Dr2Obj(dr,ColumnNameEnum.DBName);
			}
			
			/// <summary>
			/// 将DataTabe转换成的Companyinfo对象集合
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="cne">dt的列名映射方式:DB列名或属性名</param>
			/// <returns>Companyinfo对象的集合</returns>
			public static IList Dt2Objs(DataTable dt,ColumnNameEnum cne)
			{
				if (dt == null)
				{
					throw new ArgumentNullException("dt");
				}
				
				ArrayList alResult = new ArrayList();
				
				foreach(DataRow dr in dt.Rows)
				{
					alResult.Add(Dr2Obj(dr,cne));
				}
				
				return alResult;
			}

			/// <summary>
			/// 将DataTabe转换成的Companyinfo对象集合(默认列名映射为属性名)
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <returns>Companyinfo对象的集合</returns>
			public static IList Dt2Objs(DataTable dt)
			{
				return Dt2Objs(dt,ColumnNameEnum.PropertyName);
			}
			
			/// <summary>
			/// 用objs的Companyinfo对象集合填充DataTable
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="objs">Companyinfo对象集合</param>
			/// <param name="cne">dt的列名映射方式:DB列名或属性名</param>
			public static void FillDataTable(DataTable dt,IList objs,ColumnNameEnum cne)
			{
				if (dt == null)
				{
					throw new ArgumentNullException("dt");
				}
				if (objs == null)
				{
					throw new ArgumentNullException("objs");
				}
				
				foreach(Companyinfo obj in objs)
				{
					DataRow dr = dt.NewRow();
					obj.FillDataRow(dr,cne);
					dt.Rows.Add(dr);
				}
			}

			/// <summary>
			/// 用objs的Companyinfo对象集合填充DataTable(默认列名映射为属性名)
			/// </summary>
			/// <param name="dt">由CreateTable生成的DataTable</param>
			/// <param name="objs">Companyinfo对象集合</param>
			public static void FillDataTable(DataTable dt,IList objs)
			{
				FillDataTable(dt,objs,ColumnNameEnum.PropertyName);
			}
		#endregion
		
		/// <summary>
		/// 取消编辑,恢复到上次有效调用BeginEdit前的状态,并清空保留值
		/// </summary>
		public override void CancelEdit()
		{
			Companyinfo old = this.OldValue as Companyinfo;
			if (old != null)
			{
					this.Seqno = old.Seqno;
					this.Title = old.Title;
					this.Description = old.Description;
					this.Introduction = old.Introduction;
					this.Code = old.Code;
					this.Filename = old.Filename;
					this.KeyWord = old.KeyWord;
					this.ContactUs = old.ContactUs;
					this.AccStatisticsCode = old.AccStatisticsCode;
					this.Companyname = old.Companyname;
					this.Hangye = old.Hangye;
					this.Guimao = old.Guimao;
					this.Linkman = old.Linkman;
					this.Phone = old.Phone;
					this.Mobile = old.Mobile;
					this.Address = old.Address;
					this.Zip = old.Zip;
					this.Email = old.Email;
					this.Fax = old.Fax;
					this.Qq = old.Qq;
					this.Msn = old.Msn;
					this.Shenfen = old.Shenfen;
					this.City = old.City;
					this.Createby = old.Createby;
					this.Createdate = old.Createdate;
					this.LasteupdateDate = old.LasteupdateDate;
					this.Licd = old.Licd;				
				this.OldValue = null;
			}
		}
		
		
		
		
		#region Companyinfo实体的内部Key类
			/// <summary>
			/// Companyinfo实体的Key类
			/// </summary>
			public sealed class Key
			{
		
				private int m_Seqno;
				public int Seqno
				{
 					get 
					{ 
						 return m_Seqno; 
					}
					set 
					{ 
						m_Seqno = value;
					}
				}
		
				public Key(int pSeqno)
				{
					m_Seqno=pSeqno;

				}
			}
		#endregion
			/// <summary>
			/// 得到实体Companyinfo的PK
			/// </summary>
			public Key GetKey()
			{
				return new Key(Seqno);				
			}
			
				
		#endregion
	}
}
